<!DOCTYPE html>
<html>
<body>
<h2>变量</h2>
<h2>https://www.w3school.com.cn/php/php_file_create.asp</h2>

<?php  
$myfile = fopen("temp/testfile.txt", "w")
?>

<?php
// 这样会覆盖已有的文件
$myfile = fopen("temp/newfile.txt", "w") or die("Unable to open file!");
$txt = "Bill Gates\n";
fwrite($myfile, $txt);
$txt = "Steve Jobs\n";
fwrite($myfile, $txt);
fclose($myfile);
?>
</body>
</html>